// components/order/order-list-item/index.js
const componentBehaviors = require('../../../../behaviors/component');
import { COMPONENT_OPTIONS } from '../../../../constants/common';
import { AGREE_BTN_TEXT, REFUSE_BTN_TEXT } from '../../../../constants/order';

Component({
    behaviors: [componentBehaviors],
    options: {
        ...COMPONENT_OPTIONS,
    },
    properties: {
        // 售后单状态信息
        orderStatusInfo: {
            type: Object,
            value: {},
        },
        // 订单类型
        orderType: {
            type: String,
            value: '',
        },
    },
    data: {
        agreeBtnText: AGREE_BTN_TEXT,
        refuseBtnText: REFUSE_BTN_TEXT,
    },
    methods: {
        // 拒绝
        refuseAction: function() {
            this.triggerEvent('refuse');
        },
        // 同意
        agreeAction: function() {
            this.triggerEvent('agree');
        },
        refuseWarehouseAction: function () {
            this.triggerEvent('refuseWarehouse');
        },
        agreeWarehouseAction: function () {
            this.triggerEvent('agreeWarehouse');
        },
    }
})
